package com.lyt.springboot.util.algorithm;

import java.util.Scanner;
import java.util.concurrent.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String[] split = s.split(",");
        int[] arr  = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            arr[i] = Integer.parseInt(split[i]);
        }
        System.out.println(Main.count_peak(arr));

    }
    public static int count_peak(int[] hill) {
        int count = 0;
        for (int i = 0; i < hill.length; i++) {
            if(i==0 && hill[i]>hill[i+1]) {
                count++;
            }
            if(i== hill.length-1 && hill[i-1]<hill[i]) {
                count++;
            }
            if(i>0 &&i<hill.length-1 && hill[i]>hill[i+1] && hill[i]>hill[i-1]) {
                count++;
            }
        }
        return count;
    }
    public void test() {
        ExecutorService executor = new ThreadPoolExecutor(5,10,10, TimeUnit.SECONDS,new LinkedBlockingQueue<>(),new ThreadPoolExecutor.AbortPolicy());
    }
    public void test1() {
        CountDownLatch  cownDownLatch = new CountDownLatch(1);
        Thread t1=  new Thread();
        t1.start();
        cownDownLatch.countDown();
        System.out.println("t1");
        Thread t2 = new Thread();
        t2.start();
        cownDownLatch.countDown();
        System.out.println("t2");

        try {
            cownDownLatch.await();
            Thread t3 = new Thread();
            System.out.println("t3");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
